﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class User_SetAccount : System.Web.UI.Page
{
    public string userLoginName = "";
    public string strNickname = "<div class='cpzx_zc_yanz'>未验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17.jpg' width='73' height='24' style='cursor: pointer;' onclick='SetAccount(3);' /></div>";
    public string strEmail = "<div class='cpzx_zc_yanz'>未验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17.jpg' width='73' height='24' style='cursor: pointer;' onclick='SetAccount(2);' /></div>";
    public string strMobile = "<div class='cpzx_zc_yanz'>未验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17.jpg' width='73' height='24' style='cursor: pointer;' onclick='SetAccount(1);' /></div>";
    public string strEM = "<div class='cpzx_zc_yanz'>未验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17.jpg' width='73' height='24' style='cursor: pointer;' onclick='SetAccount(0);' /></div>";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HttpCookie cookie = Request.Cookies["Users"];
            if (cookie != null)
            {
                if (cookie["userGuid"] != "")
                {
                    hid_LoginName.Value = cookie["userGuid"];//用户唯一值识别
                }
                if (cookie["userid"] != "")
                {
                    userLoginName = cookie["userid"];
                }
                //验证用户已绑定的登录方式和未绑定的登录方式，包括：益盟号(4)、手机号(3)、昵称(1)和邮箱(2)
                //调用接口获取已绑定的登录方式

                //当前登录方式不可修改
                switch (cookie["loginType"])
                {
                    case "1":
                        strNickname = "<div class='cpzx_zc_yanz'>已验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17hui.jpg' width='73' height='24' style='cursor: pointer;' /></div>";
                        break;
                    case "2":
                        strEmail = "<div class='cpzx_zc_yanz'>已验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17hui.jpg' width='73' height='24' style='cursor: pointer;' /></div>";
                        break;
                    case "3":
                        strMobile = "<div class='cpzx_zc_yanz'>已验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17hui.jpg' width='73' height='24' style='cursor: pointer;' /></div>";
                        break;
                    case "4":
                        strEM = "<div class='cpzx_zc_yanz'>已验证</div><div class='cpzx_zc_szbutton'><img src='image/button1_17hui.jpg' width='73' height='24' style='cursor: pointer;' /></div>";
                        break;
                }
                if (cookie["multiLogin"] != "")
                {
                    //1昵称,2邮箱,4手机号,8EM号
                    int multiLogin = Convert.ToInt32(cookie["multiLogin"]);
                    
                }
            }
            else
            {
                Response.Write("<script>alert('请先注册并登录后再进行提问或查询，谢谢！。'); window.location.href='../ePioneer/ep_service.aspx';</script>");
                Response.End();
            }
        }
    }
}